home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Adobe Air 1.5 / AdobeAIRInstaller.exe / setup.swf / scripts / mx / skins / halo / HaloBorder.as < prev    next >
Text File  |  2008-10-29  |  28KB  |  682 lines

  1. package mx.skins.halo
  2. {
  3.    import flash.display.GradientType;
  4.    import flash.display.Graphics;
  5.    import mx.core.EdgeMetrics;
  6.    import mx.core.FlexVersion;
  7.    import mx.core.IContainer;
  8.    import mx.core.IUIComponent;
  9.    import mx.core.mx_internal;
  10.    import mx.graphics.RectangularDropShadow;
  11.    import mx.skins.RectangularBorder;
  12.    import mx.styles.IStyleClient;
  13.    import mx.styles.StyleManager;
  14.    import mx.utils.ColorUtil;
  15.    
  16.    use namespace mx_internal;
  17.    
  18.    public class HaloBorder extends RectangularBorder
  19.    {
  20.       
  21.       mx_internal static const VERSION:String = "3.0.0.0";
  22.       
  23.       private static var BORDER_WIDTHS:Object = {
  24.          "none":0,
  25.          "solid":1,
  26.          "inset":2,
  27.          "outset":2,
  28.          "alert":3,
  29.          "dropdown":2,
  30.          "menuBorder":1,
  31.          "comboNonEdit":2
  32.       };
  33.        
  34.       
  35.       mx_internal var radiusObj:Object;
  36.       
  37.       mx_internal var backgroundHole:Object;
  38.       
  39.       mx_internal var radius:Number;
  40.       
  41.       mx_internal var bRoundedCorners:Boolean;
  42.       
  43.       mx_internal var backgroundColor:Object;
  44.       
  45.       private var dropShadow:RectangularDropShadow;
  46.       
  47.       protected var _borderMetrics:EdgeMetrics;
  48.       
  49.       mx_internal var backgroundAlphaName:String;
  50.       
  51.       public function HaloBorder()
  52.       {
  53.          super();
  54.          BORDER_WIDTHS["default"] = 3;
  55.       }
  56.       
  57.       override public function styleChanged(param1:String) : void
  58.       {
  59.          if(param1 == null || param1 == "styleName" || param1 == "borderStyle" || param1 == "borderThickness" || param1 == "borderSides")
  60.          {
  61.             _borderMetrics = null;
  62.          }
  63.          invalidateDisplayList();
  64.       }
  65.       
  66.       override protected function updateDisplayList(param1:Number, param2:Number) : void
  67.       {
  68.          if(isNaN(param1) || isNaN(param2))
  69.          {
  70.             return;
  71.          }
  72.          super.updateDisplayList(param1,param2);
  73.          backgroundColor = getBackgroundColor();
  74.          bRoundedCorners = false;
  75.          backgroundAlphaName = "backgroundAlpha";
  76.          backgroundHole = null;
  77.          radius = 0;
  78.          radiusObj = null;
  79.          drawBorder(param1,param2);
  80.          drawBackground(param1,param2);
  81.       }
  82.       
  83.       mx_internal function drawBorder(param1:Number, param2:Number) : void
  84.       {
  85.          var _loc5_:Number = NaN;
  86.          var _loc6_:uint = 0;
  87.          var _loc7_:uint = 0;
  88.          var _loc8_:String = null;
  89.          var _loc9_:Number = NaN;
  90.          var _loc10_:uint = 0;
  91.          var _loc11_:Boolean = false;
  92.          var _loc12_:uint = 0;
  93.          var _loc13_:Array = null;
  94.          var _loc14_:Array = null;
  95.          var _loc15_:uint = 0;
  96.          var _loc16_:uint = 0;
  97.          var _loc17_:uint = 0;
  98.          var _loc18_:uint = 0;
  99.          var _loc19_:Boolean = false;
  100.          var _loc20_:Object = null;
  101.          var _loc22_:Number = NaN;
  102.          var _loc23_:Number = NaN;
  103.          var _loc24_:Number = NaN;
  104.          var _loc25_:Object = null;
  105.          var _loc27_:Number = NaN;
  106.          var _loc28_:Number = NaN;
  107.          var _loc29_:IContainer = null;
  108.          var _loc30_:EdgeMetrics = null;
  109.          var _loc31_:* = false;
  110.          var _loc32_:Number = NaN;
  111.          var _loc33_:Array = null;
  112.          var _loc34_:uint = 0;
  113.          var _loc35_:Boolean = false;
  114.          var _loc36_:Number = NaN;
  115.          var _loc3_:String = getStyle("borderStyle");
  116.          var _loc4_:Array = getStyle("highlightAlphas");
  117.          var _loc21_:Boolean = false;
  118.          var _loc26_:Graphics;
  119.          (_loc26_ = graphics).clear();
  120.          if(_loc3_)
  121.          {
  122.             switch(_loc3_)
  123.             {
  124.                case "none":
  125.                   break;
  126.                case "inset":
  127.                   _loc7_ = getStyle("borderColor");
  128.                   _loc22_ = ColorUtil.adjustBrightness2(_loc7_,-40);
  129.                   _loc23_ = ColorUtil.adjustBrightness2(_loc7_,25);
  130.                   _loc24_ = ColorUtil.adjustBrightness2(_loc7_,40);
  131.                   if((_loc25_ = mx_internal::backgroundColor) === null || _loc25_ === "")
  132.                   {
  133.                      _loc25_ = _loc7_;
  134.                   }
  135.                   draw3dBorder(_loc23_,_loc22_,_loc24_,Number(_loc25_),Number(_loc25_),Number(_loc25_));
  136.                   break;
  137.                case "outset":
  138.                   _loc7_ = getStyle("borderColor");
  139.                   _loc22_ = ColorUtil.adjustBrightness2(_loc7_,-40);
  140.                   _loc23_ = ColorUtil.adjustBrightness2(_loc7_,-25);
  141.                   _loc24_ = ColorUtil.adjustBrightness2(_loc7_,40);
  142.                   if((_loc25_ = mx_internal::backgroundColor) === null || _loc25_ === "")
  143.                   {
  144.                      _loc25_ = _loc7_;
  145.                   }
  146.                   draw3dBorder(_loc23_,_loc24_,_loc22_,Number(_loc25_),Number(_loc25_),Number(_loc25_));
  147.                   break;
  148.                case "alert":
  149.                case "default":
  150.                   if(FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
  151.                   {
  152.                      _loc27_ = getStyle("backgroundAlpha");
  153.                      _loc5_ = getStyle("borderAlpha");
  154.                      backgroundAlphaName = "borderAlpha";
  155.                      radius = getStyle("cornerRadius");
  156.                      bRoundedCorners = getStyle("roundedBottomCorners").toString().toLowerCase() == "true";
  157.                      _loc28_ = !!mx_internal::bRoundedCorners ? Number(mx_internal::radius) : Number(0);
  158.                      drawDropShadow(0,0,param1,param2,mx_internal::radius,mx_internal::radius,_loc28_,_loc28_);
  159.                      if(!mx_internal::bRoundedCorners)
  160.                      {
  161.                         radiusObj = {};
  162.                      }
  163.                      if(_loc29_ = parent as IContainer)
  164.                      {
  165.                         _loc30_ = _loc29_.viewMetrics;
  166.                         backgroundHole = {
  167.                            "x":_loc30_.left,
  168.                            "y":_loc30_.top,
  169.                            "w":Math.max(0,param1 - _loc30_.left - _loc30_.right),
  170.                            "h":Math.max(0,param2 - _loc30_.top - _loc30_.bottom),
  171.                            "r":0
  172.                         };
  173.                         if(mx_internal::backgroundHole.w > 0 && mx_internal::backgroundHole.h > 0)
  174.                         {
  175.                            if(_loc27_ != _loc5_)
  176.                            {
  177.                               drawDropShadow(mx_internal::backgroundHole.x,mx_internal::backgroundHole.y,mx_internal::backgroundHole.w,mx_internal::backgroundHole.h,0,0,0,0);
  178.                            }
  179.                            _loc26_.beginFill(Number(mx_internal::backgroundColor),_loc27_);
  180.                            _loc26_.drawRect(mx_internal::backgroundHole.x,mx_internal::backgroundHole.y,mx_internal::backgroundHole.w,mx_internal::backgroundHole.h);
  181.                            _loc26_.endFill();
  182.                         }
  183.                      }
  184.                      backgroundColor = getStyle("borderColor");
  185.                   }
  186.                   break;
  187.                case "dropdown":
  188.                   _loc12_ = getStyle("dropdownBorderColor");
  189.                   drawDropShadow(0,0,param1,param2,4,0,0,4);
  190.                   drawRoundRect(0,0,param1,param2,{
  191.                      "tl":4,
  192.                      "tr":0,
  193.                      "br":0,
  194.                      "bl":4
  195.                   },5068126,1);
  196.                   drawRoundRect(0,0,param1,param2,{
  197.                      "tl":4,
  198.                      "tr":0,
  199.                      "br":0,
  200.                      "bl":4
  201.                   },[16777215,16777215],[0.7,0],verticalGradientMatrix(0,0,param1,param2));
  202.                   drawRoundRect(1,1,param1 - 1,param2 - 2,{
  203.                      "tl":3,
  204.                      "tr":0,
  205.                      "br":0,
  206.                      "bl":3
  207.                   },16777215,1);
  208.                   drawRoundRect(1,2,param1 - 1,param2 - 3,{
  209.                      "tl":3,
  210.                      "tr":0,
  211.                      "br":0,
  212.                      "bl":3
  213.                   },[15658734,16777215],1,verticalGradientMatrix(0,0,param1 - 1,param2 - 3));
  214.                   if(!isNaN(_loc12_))
  215.                   {
  216.                      drawRoundRect(0,0,param1 + 1,param2,{
  217.                         "tl":4,
  218.                         "tr":0,
  219.                         "br":0,
  220.                         "bl":4
  221.                      },_loc12_,0.5);
  222.                      drawRoundRect(1,1,param1 - 1,param2 - 2,{
  223.                         "tl":3,
  224.                         "tr":0,
  225.                         "br":0,
  226.                         "bl":3
  227.                      },16777215,1);
  228.                      drawRoundRect(1,2,param1 - 1,param2 - 3,{
  229.                         "tl":3,
  230.                         "tr":0,
  231.                         "br":0,
  232.                         "bl":3
  233.                      },[15658734,16777215],1,verticalGradientMatrix(0,0,param1 - 1,param2 - 3));
  234.                   }
  235.                   backgroundColor = null;
  236.                   break;
  237.                case "menuBorder":
  238.                   _loc7_ = getStyle("borderColor");
  239.                   drawRoundRect(0,0,param1,param2,0,_loc7_,1);
  240.                   drawDropShadow(1,1,param1 - 2,param2 - 2,0,0,0,0);
  241.                   break;
  242.                case "comboNonEdit":
  243.                   break;
  244.                case "controlBar":
  245.                   if(param1 == 0 || param2 == 0)
  246.                   {
  247.                      backgroundColor = null;
  248.                      break;
  249.                   }
  250.                   _loc31_ = (_loc14_ = getStyle("footerColors")) != null;
  251.                   _loc32_ = getStyle("borderAlpha");
  252.                   if(_loc31_)
  253.                   {
  254.                      _loc26_.lineStyle(0,_loc14_.length > 0 ? uint(_loc14_[1]) : uint(_loc14_[0]),_loc32_);
  255.                      _loc26_.moveTo(0,0);
  256.                      _loc26_.lineTo(param1,0);
  257.                      _loc26_.lineStyle(0,0,0);
  258.                      if(parent && parent.parent && parent.parent is IStyleClient)
  259.                      {
  260.                         radius = IStyleClient(parent.parent).getStyle("cornerRadius");
  261.                         _loc32_ = IStyleClient(parent.parent).getStyle("borderAlpha");
  262.                      }
  263.                      if(isNaN(mx_internal::radius))
  264.                      {
  265.                         radius = 0;
  266.                      }
  267.                      if(IStyleClient(parent.parent).getStyle("roundedBottomCorners").toString().toLowerCase() != "true")
  268.                      {
  269.                         radius = 0;
  270.                      }
  271.                      drawRoundRect(0,1,param1,param2 - 1,{
  272.                         "tl":0,
  273.                         "tr":0,
  274.                         "bl":mx_internal::radius,
  275.                         "br":mx_internal::radius
  276.                      },_loc14_,_loc32_,verticalGradientMatrix(0,0,param1,param2));
  277.                      if(_loc14_.length > 1 && _loc14_[0] != _loc14_[1])
  278.                      {
  279.                         drawRoundRect(0,1,param1,param2 - 1,{
  280.                            "tl":0,
  281.                            "tr":0,
  282.                            "bl":mx_internal::radius,
  283.                            "br":mx_internal::radius
  284.                         },[16777215,16777215],_loc4_,verticalGradientMatrix(0,0,param1,param2));
  285.                         drawRoundRect(1,2,param1 - 2,param2 - 3,{
  286.                            "tl":0,
  287.                            "tr":0,
  288.                            "bl":mx_internal::radius - 1,
  289.                            "br":mx_internal::radius - 1
  290.                         },_loc14_,_loc32_,verticalGradientMatrix(0,0,param1,param2));
  291.                      }
  292.                   }
  293.                   backgroundColor = null;
  294.                   break;
  295.                case "applicationControlBar":
  296.                   _loc13_ = getStyle("fillColors");
  297.                   _loc5_ = getStyle("backgroundAlpha");
  298.                   _loc4_ = getStyle("highlightAlphas");
  299.                   _loc33_ = getStyle("fillAlphas");
  300.                   _loc11_ = getStyle("docked");
  301.                   _loc34_ = uint(mx_internal::backgroundColor);
  302.                   radius = getStyle("cornerRadius");
  303.                   if(!mx_internal::radius)
  304.                   {
  305.                      radius = 0;
  306.                   }
  307.                   drawDropShadow(0,1,param1,param2 - 1,mx_internal::radius,mx_internal::radius,mx_internal::radius,mx_internal::radius);
  308.                   if(mx_internal::backgroundColor !== null && StyleManager.isValidStyleValue(mx_internal::backgroundColor))
  309.                   {
  310.                      drawRoundRect(0,1,param1,param2 - 1,mx_internal::radius,_loc34_,_loc5_,verticalGradientMatrix(0,0,param1,param2));
  311.                   }
  312.                   drawRoundRect(0,1,param1,param2 - 1,mx_internal::radius,_loc13_,_loc33_,verticalGradientMatrix(0,0,param1,param2));
  313.                   drawRoundRect(0,1,param1,param2 / 2 - 1,{
  314.                      "tl":mx_internal::radius,
  315.                      "tr":mx_internal::radius,
  316.                      "bl":0,
  317.                      "br":0
  318.                   },[16777215,16777215],_loc4_,verticalGradientMatrix(0,0,param1,param2 / 2 - 1));
  319.                   drawRoundRect(0,1,param1,param2 - 1,{
  320.                      "tl":mx_internal::radius,
  321.                      "tr":mx_internal::radius,
  322.                      "bl":0,
  323.                      "br":0
  324.                   },16777215,0.3,null,GradientType.LINEAR,null,{
  325.                      "x":0,
  326.                      "y":2,
  327.                      "w":param1,
  328.                      "h":param2 - 2,
  329.                      "r":{
  330.                         "tl":mx_internal::radius,
  331.                         "tr":mx_internal::radius,
  332.                         "bl":0,
  333.                         "br":0
  334.                      }
  335.                   });
  336.                   backgroundColor = null;
  337.                   break;
  338.                default:
  339.                   _loc7_ = getStyle("borderColor");
  340.                   _loc9_ = getStyle("borderThickness");
  341.                   _loc8_ = getStyle("borderSides");
  342.                   _loc35_ = true;
  343.                   radius = getStyle("cornerRadius");
  344.                   bRoundedCorners = getStyle("roundedBottomCorners").toString().toLowerCase() == "true";
  345.                   _loc36_ = Math.max(mx_internal::radius - _loc9_,0);
  346.                   _loc20_ = {
  347.                      "x":_loc9_,
  348.                      "y":_loc9_,
  349.                      "w":param1 - _loc9_ * 2,
  350.                      "h":param2 - _loc9_ * 2,
  351.                      "r":_loc36_
  352.                   };
  353.                   if(!mx_internal::bRoundedCorners)
  354.                   {
  355.                      radiusObj = {
  356.                         "tl":mx_internal::radius,
  357.                         "tr":mx_internal::radius,
  358.                         "bl":0,
  359.                         "br":0
  360.                      };
  361.                      _loc20_.r = {
  362.                         "tl":_loc36_,
  363.                         "tr":_loc36_,
  364.                         "bl":0,
  365.                         "br":0
  366.                      };
  367.                   }
  368.                   if(_loc8_ != "left top right bottom")
  369.                   {
  370.                      _loc20_.r = {
  371.                         "tl":_loc36_,
  372.                         "tr":_loc36_,
  373.                         "bl":(!!mx_internal::bRoundedCorners ? _loc36_ : 0),
  374.                         "br":(!!mx_internal::bRoundedCorners ? _loc36_ : 0)
  375.                      };
  376.                      radiusObj = {
  377.                         "tl":mx_internal::radius,
  378.                         "tr":mx_internal::radius,
  379.                         "bl":(!!mx_internal::bRoundedCorners ? mx_internal::radius : 0),
  380.                         "br":(!!mx_internal::bRoundedCorners ? mx_internal::radius : 0)
  381.                      };
  382.                      if((_loc8_ = _loc8_.toLowerCase()).indexOf("left") == -1)
  383.                      {
  384.                         _loc20_.x = 0;
  385.                         _loc20_.w += _loc9_;
  386.                         _loc20_.r.tl = 0;
  387.                         _loc20_.r.bl = 0;
  388.                         mx_internal::radiusObj.tl = 0;
  389.                         mx_internal::radiusObj.bl = 0;
  390.                         _loc35_ = false;
  391.                      }
  392.                      if(_loc8_.indexOf("top") == -1)
  393.                      {
  394.                         _loc20_.y = 0;
  395.                         _loc20_.h += _loc9_;
  396.                         _loc20_.r.tl = 0;
  397.                         _loc20_.r.tr = 0;
  398.                         mx_internal::radiusObj.tl = 0;
  399.                         mx_internal::radiusObj.tr = 0;
  400.                         _loc35_ = false;
  401.                      }
  402.                      if(_loc8_.indexOf("right") == -1)
  403.                      {
  404.                         _loc20_.w += _loc9_;
  405.                         _loc20_.r.tr = 0;
  406.                         _loc20_.r.br = 0;
  407.                         mx_internal::radiusObj.tr = 0;
  408.                         mx_internal::radiusObj.br = 0;
  409.                         _loc35_ = false;
  410.                      }
  411.                      if(_loc8_.indexOf("bottom") == -1)
  412.                      {
  413.                         _loc20_.h += _loc9_;
  414.                         _loc20_.r.bl = 0;
  415.                         _loc20_.r.br = 0;
  416.                         mx_internal::radiusObj.bl = 0;
  417.                         mx_internal::radiusObj.br = 0;
  418.                         _loc35_ = false;
  419.                      }
  420.                   }
  421.                   if(mx_internal::radius == 0 && _loc35_)
  422.                   {
  423.                      drawDropShadow(0,0,param1,param2,0,0,0,0);
  424.                      _loc26_.beginFill(_loc7_);
  425.                      _loc26_.drawRect(0,0,param1,param2);
  426.                      _loc26_.drawRect(_loc9_,_loc9_,param1 - 2 * _loc9_,param2 - 2 * _loc9_);
  427.                      _loc26_.endFill();
  428.                   }
  429.                   else if(mx_internal::radiusObj)
  430.                   {
  431.                      drawDropShadow(0,0,param1,param2,mx_internal::radiusObj.tl,mx_internal::radiusObj.tr,mx_internal::radiusObj.br,mx_internal::radiusObj.bl);
  432.                      drawRoundRect(0,0,param1,param2,mx_internal::radiusObj,_loc7_,1,null,null,null,_loc20_);
  433.                      mx_internal::radiusObj.tl = Math.max(mx_internal::radius - _loc9_,0);
  434.                      mx_internal::radiusObj.tr = Math.max(mx_internal::radius - _loc9_,0);
  435.                      mx_internal::radiusObj.bl = !!mx_internal::bRoundedCorners ? Math.max(mx_internal::radius - _loc9_,0) : 0;
  436.                      mx_internal::radiusObj.br = !!mx_internal::bRoundedCorners ? Math.max(mx_internal::radius - _loc9_,0) : 0;
  437.                   }
  438.                   else
  439.                   {
  440.                      drawDropShadow(0,0,param1,param2,mx_internal::radius,mx_internal::radius,mx_internal::radius,mx_internal::radius);
  441.                      drawRoundRect(0,0,param1,param2,mx_internal::radius,_loc7_,1,null,null,null,_loc20_);
  442.                      radius = Math.max(getStyle("cornerRadius") - _loc9_,0);
  443.                   }
  444.             }
  445.          }
  446.       }
  447.       
  448.       mx_internal function drawBackground(param1:Number, param2:Number) : void
  449.       {
  450.          var _loc4_:Number = NaN;
  451.          var _loc5_:Number = NaN;
  452.          var _loc6_:EdgeMetrics = null;
  453.          var _loc7_:Graphics = null;
  454.          var _loc8_:Number = NaN;
  455.          var _loc9_:Number = NaN;
  456.          var _loc10_:Array = null;
  457.          var _loc11_:Number = NaN;
  458.          if(mx_internal::backgroundColor !== null && mx_internal::backgroundColor !== "" || getStyle("mouseShield") || getStyle("mouseShieldChildren"))
  459.          {
  460.             _loc4_ = Number(mx_internal::backgroundColor);
  461.             _loc5_ = 1;
  462.             _loc6_ = getBackgroundColorMetrics();
  463.             _loc7_ = graphics;
  464.             if(isNaN(_loc4_) || mx_internal::backgroundColor === "" || mx_internal::backgroundColor === null)
  465.             {
  466.                _loc5_ = 0;
  467.                _loc4_ = 16777215;
  468.             }
  469.             else
  470.             {
  471.                _loc5_ = getStyle(mx_internal::backgroundAlphaName);
  472.             }
  473.             if(mx_internal::radius != 0 || mx_internal::backgroundHole)
  474.             {
  475.                _loc8_ = _loc6_.bottom;
  476.                if(mx_internal::radiusObj)
  477.                {
  478.                   _loc9_ = !!mx_internal::bRoundedCorners ? Number(mx_internal::radius) : Number(0);
  479.                   radiusObj = {
  480.                      "tl":mx_internal::radius,
  481.                      "tr":mx_internal::radius,
  482.                      "bl":_loc9_,
  483.                      "br":_loc9_
  484.                   };
  485.                   drawRoundRect(_loc6_.left,_loc6_.top,width - (_loc6_.left + _loc6_.right),height - (_loc6_.top + _loc8_),mx_internal::radiusObj,_loc4_,_loc5_,null,GradientType.LINEAR,null,mx_internal::backgroundHole);
  486.                }
  487.                else
  488.                {
  489.                   drawRoundRect(_loc6_.left,_loc6_.top,width - (_loc6_.left + _loc6_.right),height - (_loc6_.top + _loc8_),mx_internal::radius,_loc4_,_loc5_,null,GradientType.LINEAR,null,mx_internal::backgroundHole);
  490.                }
  491.             }
  492.             else
  493.             {
  494.                _loc7_.beginFill(_loc4_,_loc5_);
  495.                _loc7_.drawRect(_loc6_.left,_loc6_.top,param1 - _loc6_.right - _loc6_.left,param2 - _loc6_.bottom - _loc6_.top);
  496.                _loc7_.endFill();
  497.             }
  498.          }
  499.          var _loc3_:String = getStyle("borderStyle");
  500.          if(FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 && (_loc3_ == "alert" || _loc3_ == "default") && getStyle("headerColors") == null)
  501.          {
  502.             _loc11_ = !!(_loc10_ = getStyle("highlightAlphas")) ? Number(_loc10_[0]) : Number(0.3);
  503.             drawRoundRect(0,0,param1,param2,{
  504.                "tl":mx_internal::radius,
  505.                "tr":mx_internal::radius,
  506.                "bl":0,
  507.                "br":0
  508.             },16777215,_loc11_,null,GradientType.LINEAR,null,{
  509.                "x":0,
  510.                "y":1,
  511.                "w":param1,
  512.                "h":param2 - 1,
  513.                "r":{
  514.                   "tl":mx_internal::radius,
  515.                   "tr":mx_internal::radius,
  516.                   "bl":0,
  517.                   "br":0
  518.                }
  519.             });
  520.          }
  521.       }
  522.       
  523.       mx_internal function drawDropShadow(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:Number) : void
  524.       {
  525.          var _loc11_:Number = NaN;
  526.          var _loc12_:Boolean = false;
  527.          if(getStyle("dropShadowEnabled") == false || getStyle("dropShadowEnabled") == "false" || param3 == 0 || param4 == 0)
  528.          {
  529.             return;
  530.          }
  531.          var _loc9_:Number = getStyle("shadowDistance");
  532.          var _loc10_:String = getStyle("shadowDirection");
  533.          if(getStyle("borderStyle") == "applicationControlBar")
  534.          {
  535.             _loc11_ = !!(_loc12_ = getStyle("docked")) ? Number(90) : Number(getDropShadowAngle(_loc9_,_loc10_));
  536.             _loc9_ = Math.abs(_loc9_);
  537.          }
  538.          else
  539.          {
  540.             _loc11_ = getDropShadowAngle(_loc9_,_loc10_);
  541.             _loc9_ = Math.abs(_loc9_) + 2;
  542.          }
  543.          if(!dropShadow)
  544.          {
  545.             dropShadow = new RectangularDropShadow();
  546.          }
  547.          dropShadow.distance = _loc9_;
  548.          dropShadow.angle = _loc11_;
  549.          dropShadow.color = getStyle("dropShadowColor");
  550.          dropShadow.alpha = 0.4;
  551.          dropShadow.tlRadius = param5;
  552.          dropShadow.trRadius = param6;
  553.          dropShadow.blRadius = param8;
  554.          dropShadow.brRadius = param7;
  555.          dropShadow.drawShadow(graphics,param1,param2,param3,param4);
  556.       }
  557.       
  558.       mx_internal function getBackgroundColor() : Object
  559.       {
  560.          var _loc2_:Object = null;
  561.          var _loc1_:IUIComponent = parent as IUIComponent;
  562.          if(_loc1_ && !_loc1_.enabled)
  563.          {
  564.             _loc2_ = getStyle("backgroundDisabledColor");
  565.             if(_loc2_ !== null && StyleManager.isValidStyleValue(_loc2_))
  566.             {
  567.                return _loc2_;
  568.             }
  569.          }
  570.          return getStyle("backgroundColor");
  571.       }
  572.       
  573.       mx_internal function draw3dBorder(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number) : void
  574.       {
  575.          var _loc7_:Number = width;
  576.          var _loc8_:Number = height;
  577.          drawDropShadow(0,0,width,height,0,0,0,0);
  578.          var _loc9_:Graphics;
  579.          (_loc9_ = graphics).beginFill(param1);
  580.          _loc9_.drawRect(0,0,_loc7_,_loc8_);
  581.          _loc9_.drawRect(1,0,_loc7_ - 2,_loc8_);
  582.          _loc9_.endFill();
  583.          _loc9_.beginFill(param2);
  584.          _loc9_.drawRect(1,0,_loc7_ - 2,1);
  585.          _loc9_.endFill();
  586.          _loc9_.beginFill(param3);
  587.          _loc9_.drawRect(1,_loc8_ - 1,_loc7_ - 2,1);
  588.          _loc9_.endFill();
  589.          _loc9_.beginFill(param4);
  590.          _loc9_.drawRect(1,1,_loc7_ - 2,1);
  591.          _loc9_.endFill();
  592.          _loc9_.beginFill(param5);
  593.          _loc9_.drawRect(1,_loc8_ - 2,_loc7_ - 2,1);
  594.          _loc9_.endFill();
  595.          _loc9_.beginFill(param6);
  596.          _loc9_.drawRect(1,2,_loc7_ - 2,_loc8_ - 4);
  597.          _loc9_.drawRect(2,2,_loc7_ - 4,_loc8_ - 4);
  598.          _loc9_.endFill();
  599.       }
  600.       
  601.       mx_internal function getBackgroundColorMetrics() : EdgeMetrics
  602.       {
  603.          return borderMetrics;
  604.       }
  605.       
  606.       mx_internal function getDropShadowAngle(param1:Number, param2:String) : Number
  607.       {
  608.          if(param2 == "left")
  609.          {
  610.             return param1 >= 0 ? Number(135) : Number(225);
  611.          }
  612.          if(param2 == "right")
  613.          {
  614.             return param1 >= 0 ? Number(45) : Number(315);
  615.          }
  616.          return param1 >= 0 ? Number(90) : Number(270);
  617.       }
  618.       
  619.       override public function get borderMetrics() : EdgeMetrics
  620.       {
  621.          var _loc1_:Number = NaN;
  622.          var _loc3_:String = null;
  623.          if(_borderMetrics)
  624.          {
  625.             return _borderMetrics;
  626.          }
  627.          var _loc2_:String = getStyle("borderStyle");
  628.          if(_loc2_ == "default" || _loc2_ == "alert")
  629.          {
  630.             if(FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
  631.             {
  632.                return EdgeMetrics.EMPTY;
  633.             }
  634.             _borderMetrics = new EdgeMetrics(0,0,0,0);
  635.          }
  636.          else if(_loc2_ == "controlBar" || _loc2_ == "applicationControlBar")
  637.          {
  638.             _borderMetrics = new EdgeMetrics(1,1,1,1);
  639.          }
  640.          else if(_loc2_ == "solid")
  641.          {
  642.             _loc1_ = getStyle("borderThickness");
  643.             if(isNaN(_loc1_))
  644.             {
  645.                _loc1_ = 0;
  646.             }
  647.             _borderMetrics = new EdgeMetrics(_loc1_,_loc1_,_loc1_,_loc1_);
  648.             _loc3_ = getStyle("borderSides");
  649.             if(_loc3_ != "left top right bottom")
  650.             {
  651.                if(_loc3_.indexOf("left") == -1)
  652.                {
  653.                   _borderMetrics.left = 0;
  654.                }
  655.                if(_loc3_.indexOf("top") == -1)
  656.                {
  657.                   _borderMetrics.top = 0;
  658.                }
  659.                if(_loc3_.indexOf("right") == -1)
  660.                {
  661.                   _borderMetrics.right = 0;
  662.                }
  663.                if(_loc3_.indexOf("bottom") == -1)
  664.                {
  665.                   _borderMetrics.bottom = 0;
  666.                }
  667.             }
  668.          }
  669.          else
  670.          {
  671.             _loc1_ = BORDER_WIDTHS[_loc2_];
  672.             if(isNaN(_loc1_))
  673.             {
  674.                _loc1_ = 0;
  675.             }
  676.             _borderMetrics = new EdgeMetrics(_loc1_,_loc1_,_loc1_,_loc1_);
  677.          }
  678.          return _borderMetrics;
  679.       }
  680.    }
  681. }
  682.